package com.xiweicheng.test.jpa.entity;
// Generated 2018-7-13 22:08:49 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * Project generated by hbm2java
 */
@Entity
@Table(name = "project", catalog = "tms")
public class Project implements java.io.Serializable {

	private Long id;
	private long version;
	private Language language;
	private Date createDate;
	private String creator;
	private String description;
	private String name;
	private String status;
	private Date updateDate;
	private String updater;
	private Set<Language> languages = new HashSet<Language>(0);
	private Set<Users> userses = new HashSet<Users>(0);
	private Set<Translate> translates = new HashSet<Translate>(0);
	private Set<Users> userses_1 = new HashSet<Users>(0);

	public Project() {
	}

	public Project(String status) {
		this.status = status;
	}

	public Project(Language language, Date createDate, String creator, String description, String name, String status,
			Date updateDate, String updater, Set<Language> languages, Set<Users> userses, Set<Translate> translates,
			Set<Users> userses_1) {
		this.language = language;
		this.createDate = createDate;
		this.creator = creator;
		this.description = description;
		this.name = name;
		this.status = status;
		this.updateDate = updateDate;
		this.updater = updater;
		this.languages = languages;
		this.userses = userses;
		this.translates = translates;
		this.userses_1 = userses_1;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "language_id")
	public Language getLanguage() {
		return this.language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "creator")
	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "description", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Column(name = "updater")
	public String getUpdater() {
		return this.updater;
	}

	public void setUpdater(String updater) {
		this.updater = updater;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "language_project", catalog = "tms", joinColumns = {
			@JoinColumn(name = "project_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "language_id", nullable = false, updatable = false) })
	public Set<Language> getLanguages() {
		return this.languages;
	}

	public void setLanguages(Set<Language> languages) {
		this.languages = languages;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "user_project", catalog = "tms", joinColumns = {
			@JoinColumn(name = "project_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<Users> getUserses() {
		return this.userses;
	}

	public void setUserses(Set<Users> userses) {
		this.userses = userses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "project")
	public Set<Translate> getTranslates() {
		return this.translates;
	}

	public void setTranslates(Set<Translate> translates) {
		this.translates = translates;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "watcher_project", catalog = "tms", joinColumns = {
			@JoinColumn(name = "project_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<Users> getUserses_1() {
		return this.userses_1;
	}

	public void setUserses_1(Set<Users> userses_1) {
		this.userses_1 = userses_1;
	}

}
